package ysm.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import ysm.entity.User;
import ysm.mapper.UserMapper;
import ysm.service.UserService;

@RestController
public class LoginController {
	
	@Autowired
	private UserService userService;
	
	@RequestMapping("/public/login_page_self")
	public String loginPage () {
		return "loginPage";
	}
	
	@RequestMapping("/public/regester")
	public boolean regester(String username, String password) {
		User user = new User();
		user.setUsername(username);
		user.setPassword(password);
		return userService.addUser(user);
	}

}
